<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="random">生成</button>
        <li v-for="(v,i) in numList">{{ v }}</li>
        <button @click="del(i)">删除</button>
    </div>
    <script src="../vue.js"></script>
    <script>
       new Vue({
            el:'#app',
            data:{
       numList:[1,2,6],
            },
            methods:{
                del(i){
     this.numList.splice(i,1)
                },
                random(){
      this.numList.push(Math.floor(Math.random()*21))
                }
            }
        })
    </script>
</body>
</html>